import { NoSkinCellRenderer } from "../../common/item/NoSkinCellRenderer";
import { ObjCreate } from "../../common/ObjCreate";
import { GlobalStyle } from "../../../../common/global/GlobalStyle";
import { WrestleWeekData } from "../wrestleData/WrestleWeekData";
import { ItemData } from "../../../resource/info/ItemData";
import { ToolTipsManager } from "../../../../../com/mui/manager/ToolTipsManager";
import { NormalTooltip } from "../../common/tooltip/NormalTooltip";
import { Language } from "../../../../../extend/language/Language";
//class WrestleWeekCellRenderer
    
    export  class WrestleWeekCellRenderer extends NoSkinCellRenderer
    {
        constructor()
        {
            super();
            return;
        }

        protected /* override */ createChildren(): void
        {
            super.createChildren();
            ObjCreate.createBg(0, 0, 230, 2, this, "SplitLine");
            var loc1=GlobalStyle.getTextFormatCenter(GlobalStyle.textFormat1);
            this._tfRank = ObjCreate.createTextField("", 0, 7, 85, 20, this, loc1);
            this._tfReward = ObjCreate.createTextField("", 85, 7, 133, 20, this, loc1);
            return;
        }

        public /* override */ set data(arg1: Object)
        {
            super.data = arg1;
            if (typeof arg1 === "wrestleweekdata") 
            {
                this._wrestleData = arg1 as WrestleWeekData;
                this.updateView();
            }
            return;
        }

        /* internal  */updateView(): void
        {
            var loc1=null;
            this._tfRank.text = this._wrestleData.rank;
            if (this._wrestleData.rewardItemCode > 0) 
            {
                loc1 = new ItemData(this._wrestleData.rewardItemCode);
                this._tfReward.htmlText = "<u>" + loc1.itemInfo.htmlName + "</u>";
                ToolTipsManager.register(this._tfReward, NormalTooltip, loc1.getToolTipData());
            }
            else 
            {
                this._tfReward.text = Language.getString(44372);
            }
            return;
        }

        /* internal */ /* var */_wrestleData: WrestleWeekData;

        /* internal */ /* var */_tfRank: Object /* flash.text.TextField */;

        /* internal */ /* var */_tfReward: Object /* flash.text.TextField */;
    }
